#!/bin/bash

wget --timeout=5 --quiet https://dist.ipfs.io/go-ipfs/v0.7.0/go-ipfs_v0.7.0_linux-amd64.tar.gz
sleep 5
if [[ -f "/root/go-ipfs_v0.7.0_linux-amd64.tar.gz" ]]
then
    echo "ipfs_0.7.gz file exists on your filesystem."
    # Get its PID
    PID=$!
    # Wait for 2 seconds
    sleep 2
    # Kill it
    kill $PID    
else
    echo "ipfs_0.7.gz file NOT exists on your filesystem."
    # Get its PID
    PID=$!
    # Wait for 2 seconds
    sleep 5
    # Kill it
    kill $PID        
fi
